home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / GWMALLOC.ZIP;1 / GWMALLOC.TAR / gw_malloc / configure < prev    next >
Encoding:
Text File  |  1993-04-08  |  16.3 KB  |  618 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      *) ;;
  74.     esac
  75.   fi
  76. done
  77.  
  78. trap 'rm -f conftest* core; exit 1' 1 3 15
  79.  
  80. rm -f conftest*
  81. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  82.  
  83. # A filename unique to this package, relative to the directory that
  84. # configure is in, which we can look for to find out if srcdir is correct.
  85. unique_file=malloc.c
  86.  
  87. # Find the source files, if location was not specified.
  88. if test -z "$srcdir"; then
  89.   srcdirdefaulted=yes
  90.   # Try the directory containing this script, then `..'.
  91.   prog=$0
  92.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  93.   test "X$confdir" = "X$prog" && confdir=.
  94.   srcdir=$confdir
  95.   if test ! -r $srcdir/$unique_file; then
  96.     srcdir=..
  97.   fi
  98. fi
  99. if test ! -r $srcdir/$unique_file; then
  100.   if test x$srcdirdefaulted = xyes; then
  101.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  102.   else
  103.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  104.   fi
  105.   exit 1
  106. fi
  107. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  108. # But we can't avoid them for `..', to make subdirectories work.
  109. case $srcdir in
  110.   .|/*|~*) ;;
  111.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  112. esac
  113.  
  114.  
  115. echo Configuring for the malloc-debug library
  116. echo .
  117. echo checking programs:
  118. if test -z "$CC"; then
  119.   echo checking for gcc
  120.   saveifs="$IFS"; IFS="${IFS}:"
  121.   for dir in $PATH; do
  122.     test -z "$dir" && dir=.
  123.     if test -f $dir/gcc; then
  124.       CC="gcc"
  125.       break
  126.     fi
  127.   done
  128.   IFS="$saveifs"
  129. fi
  130. test -z "$CC" && CC="cc"
  131.  
  132. # Find out if we are using GNU C, under whatever name.
  133. cat > conftest.c <<EOF
  134. #ifdef __GNUC__
  135.   yes
  136. #endif
  137. EOF
  138. ${CC-cc} -E conftest.c > conftest.out 2>&1
  139. if egrep yes conftest.out >/dev/null 2>&1; then
  140.   GCC=1 # For later tests.
  141. fi
  142. rm -f conftest*
  143.  
  144. # Make sure to not get the incompatible SysV /etc/install and
  145. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  146. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  147. # or the AFS install, which mishandles nonexistent args.  (Sigh.)
  148. if test -z "$INSTALL"; then
  149.   echo checking for install
  150.   saveifs="$IFS"; IFS="${IFS}:"
  151.   for dir in $PATH; do
  152.     test -z "$dir" && dir=.
  153.     case $dir in
  154.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  155.     *)
  156.       if test -f $dir/install; then
  157.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  158.       : # AIX
  159.     else
  160.       INSTALL="$dir/install -c"
  161.       INSTALL_PROGRAM='$(INSTALL)'
  162.       INSTALL_DATA='$(INSTALL) -m 644'
  163.       break
  164.     fi
  165.       fi
  166.       ;;
  167.     esac
  168.   done
  169.   IFS="$saveifs"
  170. fi
  171. INSTALL=${INSTALL-cp}
  172. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  173. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  174.  
  175. if test -z "$RANLIB"; then
  176.   echo checking for ranlib
  177.   saveifs="$IFS"; IFS="${IFS}:"
  178.   for dir in $PATH; do
  179.     test -z "$dir" && dir=.
  180.     if test -f $dir/ranlib; then
  181.       RANLIB="ranlib"
  182.       break
  183.     fi
  184.   done
  185.   IFS="$saveifs"
  186. fi
  187. test -z "$RANLIB" && RANLIB="@:"
  188.  
  189. echo .
  190. echo checking functions:
  191. for func in bcmp bcopy memcmp memcpy memset
  192. do
  193. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  194. echo checking for ${func}
  195. cat > conftest.c <<EOF
  196. #include <stdio.h>
  197. main() { exit(0); } 
  198. t() { 
  199. #ifdef __stub_${func}
  200. choke me
  201. #else
  202. /* Override any gcc2 internal prototype to avoid an error.  */
  203. extern char ${func}(); ${func}();
  204. #endif
  205.  }
  206. EOF
  207. if eval $compile; then
  208.   DEFS="$DEFS -D${trfunc}=1"
  209. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  210. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  211. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  212. "
  213. fi
  214. rm -f conftest*
  215. #endif
  216. done
  217.  
  218. echo checking for _index
  219. cat > conftest.c <<EOF
  220.  
  221. main() { exit(0); }
  222. t() {
  223. #ifdef __stub_index
  224. choke me
  225. #else
  226. /* Override any gcc2 internal prototype to avoid an error.  */
  227. extern char index(); index();
  228. #endif
  229.  }
  230.  
  231. EOF
  232. eval $compile
  233. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  234.   
  235. DEFS="$DEFS -DHAVE_INDEX=1"
  236. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_INDEX\${SEDdB}HAVE_INDEX\${SEDdC}1\${SEDdD}
  237. \${SEDuA}HAVE_INDEX\${SEDuB}HAVE_INDEX\${SEDuC}1\${SEDuD}
  238. \${SEDeA}HAVE_INDEX\${SEDeB}HAVE_INDEX\${SEDeC}1\${SEDeD}
  239. "
  240.  
  241. else
  242.   
  243. DEFS="$DEFS -DHAVE_INDEX=0"
  244. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_INDEX\${SEDdB}HAVE_INDEX\${SEDdC}0\${SEDdD}
  245. \${SEDuA}HAVE_INDEX\${SEDuB}HAVE_INDEX\${SEDuC}0\${SEDuD}
  246. \${SEDeA}HAVE_INDEX\${SEDeB}HAVE_INDEX\${SEDeC}0\${SEDeD}
  247. "
  248.  
  249. fi
  250. rm -f conftest*
  251. for func in rindex
  252. do
  253. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  254. echo checking for ${func}
  255. cat > conftest.c <<EOF
  256. #include <stdio.h>
  257. main() { exit(0); } 
  258. t() { 
  259. #ifdef __stub_${func}
  260. choke me
  261. #else
  262. /* Override any gcc2 internal prototype to avoid an error.  */
  263. extern char ${func}(); ${func}();
  264. #endif
  265.  }
  266. EOF
  267. if eval $compile; then
  268.   DEFS="$DEFS -D${trfunc}=1"
  269. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  270. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  271. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  272. "
  273. fi
  274. rm -f conftest*
  275. #endif
  276. done
  277.  
  278. for func in strcat strcmp strlen strtok
  279. do
  280. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  281. echo checking for ${func}
  282. cat > conftest.c <<EOF
  283. #include <stdio.h>
  284. main() { exit(0); } 
  285. t() { 
  286. #ifdef __stub_${func}
  287. choke me
  288. #else
  289. /* Override any gcc2 internal prototype to avoid an error.  */
  290. extern char ${func}(); ${func}();
  291. #endif
  292.  }
  293. EOF
  294. if eval $compile; then
  295.   DEFS="$DEFS -D${trfunc}=1"
  296. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  297. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  298. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  299. "
  300. fi
  301. rm -f conftest*
  302. #endif
  303. done
  304.  
  305. echo .
  306. echo checking various functions for string checking
  307. for func in bzero
  308. do
  309. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  310. echo checking for ${func}
  311. cat > conftest.c <<EOF
  312. #include <stdio.h>
  313. main() { exit(0); } 
  314. t() { 
  315. #ifdef __stub_${func}
  316. choke me
  317. #else
  318. /* Override any gcc2 internal prototype to avoid an error.  */
  319. extern char ${func}(); ${func}();
  320. #endif
  321.  }
  322. EOF
  323. if eval $compile; then
  324.   DEFS="$DEFS -D${trfunc}=1"
  325. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  326. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  327. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  328. "
  329. fi
  330. rm -f conftest*
  331. #endif
  332. done
  333.  
  334. for func in memccpy memchr
  335. do
  336. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  337. echo checking for ${func}
  338. cat > conftest.c <<EOF
  339. #include <stdio.h>
  340. main() { exit(0); } 
  341. t() { 
  342. #ifdef __stub_${func}
  343. choke me
  344. #else
  345. /* Override any gcc2 internal prototype to avoid an error.  */
  346. extern char ${func}(); ${func}();
  347. #endif
  348.  }
  349. EOF
  350. if eval $compile; then
  351.   DEFS="$DEFS -D${trfunc}=1"
  352. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  353. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  354. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  355. "
  356. fi
  357. rm -f conftest*
  358. #endif
  359. done
  360.  
  361. for func in strchr strrchr strcpy strncpy strcasecmp strncasecmp
  362. do
  363. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  364. echo checking for ${func}
  365. cat > conftest.c <<EOF
  366. #include <stdio.h>
  367. main() { exit(0); } 
  368. t() { 
  369. #ifdef __stub_${func}
  370. choke me
  371. #else
  372. /* Override any gcc2 internal prototype to avoid an error.  */
  373. extern char ${func}(); ${func}();
  374. #endif
  375.  }
  376. EOF
  377. if eval $compile; then
  378.   DEFS="$DEFS -D${trfunc}=1"
  379. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  380. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  381. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  382. "
  383. fi
  384. rm -f conftest*
  385. #endif
  386. done
  387.  
  388. for func in strspn strcspn strncat strncmp strpbrk strstr
  389. do
  390. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  391. echo checking for ${func}
  392. cat > conftest.c <<EOF
  393. #include <stdio.h>
  394. main() { exit(0); } 
  395. t() { 
  396. #ifdef __stub_${func}
  397. choke me
  398. #else
  399. /* Override any gcc2 internal prototype to avoid an error.  */
  400. extern char ${func}(); ${func}();
  401. #endif
  402.  }
  403. EOF
  404. if eval $compile; then
  405.   DEFS="$DEFS -D${trfunc}=1"
  406. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  407. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  408. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  409. "
  410. fi
  411. rm -f conftest*
  412. #endif
  413. done
  414.  
  415. echo .
  416. echo PLEASE WATCH: checking for very important functionality:
  417. for func in sbrk
  418. do
  419. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  420. echo checking for ${func}
  421. cat > conftest.c <<EOF
  422. #include <stdio.h>
  423. main() { exit(0); } 
  424. t() { 
  425. #ifdef __stub_${func}
  426. choke me
  427. #else
  428. /* Override any gcc2 internal prototype to avoid an error.  */
  429. extern char ${func}(); ${func}();
  430. #endif
  431.  }
  432. EOF
  433. if eval $compile; then
  434.   DEFS="$DEFS -D${trfunc}=1"
  435. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  436. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  437. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  438. "
  439. fi
  440. rm -f conftest*
  441. #endif
  442. done
  443.  
  444. echo checking for heap ordering...
  445. cat > conftest.c <<EOF
  446.  
  447. main()
  448. {
  449.   char    * first, *next;
  450.   first = sbrk(1024);
  451.   next = sbrk(1024);
  452.   if (next > first)
  453.     exit(0);
  454.   else
  455.     exit(1);
  456. }
  457.  
  458. EOF
  459. eval $compile
  460. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  461.   
  462. DEFS="$DEFS -DHEAP_GROWS_UP=1"
  463. SEDDEFS="${SEDDEFS}\${SEDdA}HEAP_GROWS_UP\${SEDdB}HEAP_GROWS_UP\${SEDdC}1\${SEDdD}
  464. \${SEDuA}HEAP_GROWS_UP\${SEDuB}HEAP_GROWS_UP\${SEDuC}1\${SEDuD}
  465. \${SEDeA}HEAP_GROWS_UP\${SEDeB}HEAP_GROWS_UP\${SEDeC}1\${SEDeD}
  466. "
  467. echo '   FYI: your heap seems to grow up.'
  468.  
  469. else
  470.   
  471. DEFS="$DEFS -DHEAP_GROWS_UP=0"
  472. SEDDEFS="${SEDDEFS}\${SEDdA}HEAP_GROWS_UP\${SEDdB}HEAP_GROWS_UP\${SEDdC}0\${SEDdD}
  473. \${SEDuA}HEAP_GROWS_UP\${SEDuB}HEAP_GROWS_UP\${SEDuC}0\${SEDuD}
  474. \${SEDeA}HEAP_GROWS_UP\${SEDeB}HEAP_GROWS_UP\${SEDeC}0\${SEDeD}
  475. "
  476. echo '   FYI: your heap seems to grow down.'
  477. echo '   WARNING: the library has little support for this.'
  478.  
  479. fi
  480. rm -f conftest*
  481. echo .
  482. if test -n "$prefix"; then
  483.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  484.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  485. fi
  486. if test -n "$exec_prefix"; then
  487.   prsub="$prsub
  488. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  489. exec_prefix\\1=\\2$exec_prefix%"
  490. fi
  491.  
  492. trap 'rm -f config.status; exit 1' 1 3 15
  493. echo creating config.status
  494. rm -f config.status
  495. cat > config.status <<EOF
  496. #!/bin/sh
  497. # Generated automatically by configure.
  498. # Run this file to recreate the current configuration.
  499. # This directory was configured as follows,
  500. # on host `(hostname || uname -n) 2>/dev/null`:
  501. #
  502. # $0 $*
  503.  
  504. for arg
  505. do
  506.   case "\$arg" in
  507.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  508.     exec /bin/sh $0 $* ;;
  509.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  510.   esac
  511. done
  512.  
  513. trap 'rm -f Makefile conf.h conftest*; exit 1' 1 3 15
  514. CC='$CC'
  515. INSTALL='$INSTALL'
  516. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  517. INSTALL_DATA='$INSTALL_DATA'
  518. RANLIB='$RANLIB'
  519. LIBS='$LIBS'
  520. srcdir='$srcdir'
  521. prefix='$prefix'
  522. exec_prefix='$exec_prefix'
  523. prsub='$prsub'
  524. EOF
  525. cat >> config.status <<\EOF
  526.  
  527. top_srcdir=$srcdir
  528. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  529.   srcdir=$top_srcdir
  530.   # Remove last slash and all that follows it.  Not all systems have dirname.
  531.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  532.   if test "$dir" != "$file"; then
  533.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  534.     test ! -d $dir && mkdir $dir
  535.   fi
  536.   echo creating $file
  537.   rm -f $file
  538.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  539.   sed -e "
  540. $prsub
  541. s%@CC@%$CC%g
  542. s%@INSTALL@%$INSTALL%g
  543. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  544. s%@INSTALL_DATA@%$INSTALL_DATA%g
  545. s%@RANLIB@%$RANLIB%g
  546. s%@LIBS@%$LIBS%g
  547. s%@srcdir@%$srcdir%g
  548. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  549. fi; done
  550.  
  551. echo creating conf.h
  552. # These sed commands are put into SEDDEFS when defining a macro.
  553. # They are broken into pieces to make the sed script easier to manage.
  554. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  555. # is the cpp macro being defined and VALUE is the value it is being given.
  556. # Each defining turns into a single global substitution command.
  557. #
  558. # SEDd sets the value in "#define NAME VALUE" lines.
  559. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  560. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  561. SEDdC='\3'
  562. SEDdD='@g'
  563. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  564. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  565. SEDuB='\([     ]\)@\1#\2define\3'
  566. SEDuC=' '
  567. SEDuD='\4@g'
  568. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  569. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  570. SEDeB='$@\1#\2define\3'
  571. SEDeC=' '
  572. SEDeD='@g'
  573. rm -f conftest.sed
  574. cat > conftest.sed <<CONFEOF
  575. EOF
  576. # Turn off quoting long enough to insert the sed commands.
  577. cat >> config.status <<EOF
  578. $SEDDEFS
  579. EOF
  580. cat >> config.status <<\EOF
  581. CONFEOF
  582. rm -f conftest.h
  583. # Break up the sed commands because old seds have small limits.
  584. cp $top_srcdir/conf.h.in conftest.h1
  585. while :
  586. do
  587.   lines=`grep -c . conftest.sed`
  588.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  589.   rm -f conftest.s1 conftest.s2 conftest.h2
  590.   sed 40q conftest.sed > conftest.s1 # Like head -40.
  591.   sed 1,40d conftest.sed > conftest.s2 # Like tail +41.
  592.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  593.   rm -f conftest.s1 conftest.h1 conftest.sed
  594.   mv conftest.h2 conftest.h1
  595.   mv conftest.s2 conftest.sed
  596. done
  597. rm -f conftest.sed conftest.h
  598. echo "/* conf.h.  Generated automatically by configure.  */" > conftest.h
  599. cat conftest.h1 >> conftest.h
  600. rm -f conftest.h1
  601. if cmp -s conf.h conftest.h 2>/dev/null; then
  602.   # The file exists and we would not be changing it.
  603.   rm -f conftest.h
  604. else
  605.   rm -f conf.h
  606.   mv conftest.h conf.h
  607. fi
  608.  
  609. EOF
  610. chmod +x config.status
  611. test -n "$no_create" || ./config.status
  612.  
  613. echo .
  614. echo Done!!
  615. echo created conf.h and Makefile.
  616. echo Please check-out Makefile and especially conf.h to make sure that
  617. echo     sane configuration values were a result.
  618.